#!/usr/bin/python
# -*- coding: utf-8 -*-
# @Time: 21-3-7 上午12:52
# @Author: HuangChuQin
# @Site: 右键直接在PyCharm执行，能正常输出，在命令行执行抛异常 TypeError: str() takes at most 1 argument (2 given)
# @File: test.py
# @Software: PyCharm


def test(w):
    r1 = bytes(w, encoding="ascii")
    print(r1)
    print(type(r1))

if __name__ == "__main__":
    test("abc")
